package com.dream.example.consumer;


import com.dream.example.common.model.User;
import com.dream.example.common.service.UserService;
import com.dream.rpc.proxy.ServiceProxy;
import com.dream.rpc.proxy.ServiceProxyFactory;

/**
 * 简易服务消费者示例
 * @author Dreamer
 */
public class EasyConsumerExample {


    public static void main(String[] args) {

        //静态代理
//        UserService userService = new UserServiceProxy();

        UserService userService = ServiceProxyFactory.getProxy(UserService.class);

//        User user = new User();
//        user.setName("dream");
//
//        User newUser = userService.getUser(user);
//        if (newUser != null) {
//            System.out.println(newUser.getName());
//        } else {
//            System.out.println("user==null");
//
//        }
        System.out.println("获取的数字" + userService.getNumber());
    }
}
